/*******************************************************************************
 * Size: 16 px
 * Bpp: 4
 * Opts: --bpp 4 --size 16 --no-compress --format lvgl --font Noto Emoji-Regular.ttf --symbols 🏠📁❓⚙️ -o single_color_emoji.c
 ******************************************************************************/

#ifdef LV_LVGL_H_INCLUDE_SIMPLE
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#endif

#ifndef SINGLE_COLOR_EMOJI
#define SINGLE_COLOR_EMOJI 1
#endif

#if SINGLE_COLOR_EMOJI

/*-----------------
 *    BITMAPS
 *----------------*/

/*Store the image of the glyphs*/
static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = {
    /* U+2699 "⚙" */
    0x0, 0x0, 0x0, 0x2a, 0xa8, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x10, 0x5, 0x50, 0xa0, 0x0, 0x0,
    0x0, 0x0, 0x6b, 0x60, 0x63, 0xa, 0x2, 0xa9,
    0x0, 0x0, 0x58, 0x5, 0xb9, 0x10, 0x4a, 0xa1,
    0x48, 0x0, 0x0, 0xb1, 0x0, 0x27, 0x84, 0x0,
    0x9, 0x20, 0x0, 0x2, 0xa0, 0x67, 0x10, 0x49,
    0x5, 0x60, 0x0, 0x0, 0x47, 0x37, 0x7, 0x94,
    0x18, 0x28, 0x0, 0xc, 0x98, 0x18, 0x9, 0x20,
    0x74, 0x80, 0x79, 0xc1, 0xa0, 0x0, 0x80, 0x90,
    0x0, 0x86, 0x10, 0x8, 0x1c, 0x97, 0x18, 0x9,
    0x10, 0x64, 0x80, 0x68, 0xc1, 0x1, 0x47, 0x37,
    0x18, 0x95, 0x18, 0x28, 0x10, 0x0, 0x2, 0xa0,
    0x67, 0x10, 0x49, 0x5, 0x60, 0x0, 0x0, 0xb1,
    0x0, 0x27, 0x84, 0x0, 0x9, 0x20, 0x0, 0x58,
    0x5, 0xb9, 0x10, 0x4a, 0xa0, 0x48, 0x0, 0x0,
    0x6b, 0x60, 0x63, 0xa, 0x2, 0xa9, 0x0, 0x0,
    0x0, 0x10, 0x5, 0x50, 0xa0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0, 0x2a, 0xa8, 0x0, 0x0, 0x0,
    0x0,

    /* U+2753 "❓" */
    0x0, 0x28, 0xcc, 0xb5, 0x0, 0x4, 0xff, 0xff,
    0xff, 0xb0, 0x1f, 0xfd, 0x43, 0x8f, 0xf6, 0x5f,
    0xf1, 0x0, 0xc, 0xfa, 0x14, 0x30, 0x0, 0x9,
    0xfc, 0x0, 0x0, 0x0, 0xd, 0xf9, 0x0, 0x0,
    0x0, 0x9f, 0xf2, 0x0, 0x0, 0xa, 0xff, 0x50,
    0x0, 0x0, 0x7f, 0xf4, 0x0, 0x0, 0x0, 0xff,
    0x60, 0x0, 0x0, 0x2, 0xff, 0x10, 0x0, 0x0,
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x3, 0xdc, 0x20, 0x0, 0x0, 0xc,
    0xff, 0xa0, 0x0, 0x0, 0xb, 0xff, 0x80, 0x0,
    0x0, 0x1, 0x98, 0x0, 0x0,

    /* U+FE0F "️" */

    /* U+1F3E0 "🏠" */
    0x0, 0x0, 0x0, 0x0, 0x35, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x7, 0x91, 0x5, 0x85, 0x90, 0x0,
    0x0, 0x0, 0x0, 0xc, 0xf2, 0x67, 0x58, 0x4a,
    0x0, 0x0, 0x0, 0x0, 0x9, 0xe6, 0x75, 0x95,
    0x93, 0xa0, 0x0, 0x0, 0x0, 0x9, 0xf6, 0x68,
    0x0, 0x59, 0x3a, 0x0, 0x0, 0x0, 0xa, 0x66,
    0x80, 0x0, 0x4, 0x93, 0xa0, 0x0, 0x0, 0x76,
    0x67, 0x0, 0x0, 0x0, 0x4a, 0x3a, 0x0, 0x7,
    0x57, 0x70, 0x0, 0x0, 0x0, 0x3, 0xa2, 0xa0,
    0xb, 0xb7, 0x0, 0x0, 0x23, 0x0, 0x0, 0x3d,
    0xb3, 0x0, 0x72, 0x94, 0x92, 0xff, 0x66, 0x5a,
    0x1a, 0x0, 0x0, 0x72, 0x73, 0x75, 0xff, 0x95,
    0x38, 0x1a, 0x0, 0x0, 0x72, 0xd7, 0xe5, 0xfd,
    0x7a, 0x7f, 0x2a, 0x0, 0x0, 0x72, 0x21, 0x35,
    0xff, 0x92, 0x13, 0xa, 0x0, 0x0, 0x7c, 0x9b,
    0x65, 0xff, 0x94, 0xba, 0xbb, 0x0, 0x0, 0x9f,
    0xff, 0xfb, 0xbb, 0xbf, 0xff, 0xfe, 0x0, 0x0,
    0x26, 0x77, 0xc8, 0x77, 0x7d, 0x77, 0x64, 0x0,
    0x0, 0x0, 0x0, 0x59, 0x99, 0x98, 0x0, 0x0,
    0x0,

    /* U+1F4C1 "📁" */
    0x0, 0x0, 0x36, 0x50, 0x0, 0x0, 0x1, 0x45,
    0x0, 0x3, 0xb9, 0x63, 0xa1, 0x46, 0x9a, 0xa8,
    0x5a, 0x0, 0x6, 0x30, 0x0, 0x78, 0x63, 0x0,
    0x2, 0x5d, 0xa6, 0x99, 0x10, 0x0, 0x1, 0x47,
    0x9a, 0x97, 0x41, 0x45, 0xa0, 0x0, 0x0, 0x4a,
    0x52, 0x0, 0x0, 0x0, 0x72, 0xa0, 0x0, 0x0,
    0x81, 0x0, 0x0, 0x0, 0x0, 0x90, 0xa0, 0x58,
    0xaa, 0x80, 0x0, 0x0, 0x0, 0x0, 0xa0, 0x90,
    0xa1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa0,
    0x93, 0x70, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1,
    0x80, 0x95, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0,
    0x4, 0x50, 0x98, 0x20, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x6, 0x30, 0x8a, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x9, 0x0, 0x8b, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x2, 0x6c, 0x0, 0x89, 0x0, 0x0,
    0x0, 0x2, 0x69, 0xa8, 0x40, 0x0, 0x87, 0x0,
    0x3, 0x6a, 0xa7, 0x40, 0x0, 0x0, 0x0, 0x87,
    0x7a, 0xa7, 0x30, 0x0, 0x0, 0x0, 0x0, 0x0,
    0x46, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
    0x0
};


/*---------------------
 *  GLYPH DESCRIPTION
 *--------------------*/

static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
    {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */,
    {.bitmap_index = 0, .adv_w = 325, .box_w = 17, .box_h = 17, .ofs_x = 2, .ofs_y = -3},
    {.bitmap_index = 145, .adv_w = 325, .box_w = 10, .box_h = 17, .ofs_x = 5, .ofs_y = -3},
    {.bitmap_index = 230, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 230, .adv_w = 325, .box_w = 18, .box_h = 17, .ofs_x = 1, .ofs_y = -3},
    {.bitmap_index = 383, .adv_w = 325, .box_w = 18, .box_h = 17, .ofs_x = 1, .ofs_y = -3}
};

/*---------------------
 *  CHARACTER MAPPING
 *--------------------*/

static const uint16_t unicode_list_0[] = {
    0x0, 0xba
};

static const uint16_t unicode_list_1[] = {
    0x0, 0xf5d1, 0xf6b2
};

/*Collect the unicode lists and glyph_id offsets*/
static const lv_font_fmt_txt_cmap_t cmaps[] =
{
    {
        .range_start = 9881, .range_length = 187, .glyph_id_start = 1,
        .unicode_list = unicode_list_0, .glyph_id_ofs_list = NULL, .list_length = 2, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY
    },
    {
        .range_start = 65039, .range_length = 63155, .glyph_id_start = 3,
        .unicode_list = unicode_list_1, .glyph_id_ofs_list = NULL, .list_length = 3, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY
    }
};



/*--------------------
 *  ALL CUSTOM DATA
 *--------------------*/

#if LVGL_VERSION_MAJOR == 8
/*Store all the custom data of the font*/
static  lv_font_fmt_txt_glyph_cache_t cache;
#endif

#if LVGL_VERSION_MAJOR >= 8
static const lv_font_fmt_txt_dsc_t font_dsc = {
#else
static lv_font_fmt_txt_dsc_t font_dsc = {
#endif
    .glyph_bitmap = glyph_bitmap,
    .glyph_dsc = glyph_dsc,
    .cmaps = cmaps,
    .kern_dsc = NULL,
    .kern_scale = 0,
    .cmap_num = 2,
    .bpp = 4,
    .kern_classes = 0,
    .bitmap_format = 0,
#if LVGL_VERSION_MAJOR == 8
    .cache = &cache
#endif
};



/*-----------------
 *  PUBLIC FONT
 *----------------*/

/*Initialize a public general font descriptor*/
#if LVGL_VERSION_MAJOR >= 8
const lv_font_t single_color_emoji = {
#else
lv_font_t single_color_emoji = {
#endif
    .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt,    /*Function pointer to get glyph's data*/
    .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt,    /*Function pointer to get glyph's bitmap*/
    .line_height = 17,          /*The maximum line height required by the font*/
    .base_line = 3,             /*Baseline measured from the bottom of the line*/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
    .subpx = LV_FONT_SUBPX_NONE,
#endif
#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8
    .underline_position = 10,
    .underline_thickness = 1,
#endif
    .dsc = &font_dsc,          /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
#if LV_VERSION_CHECK(8, 2, 0) || LVGL_VERSION_MAJOR >= 9
    .fallback = NULL,
#endif
    .user_data = NULL,
};



#endif /*#if SINGLE_COLOR_EMOJI*/
